﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Kokomo
{
	public class TypedBindingList<T> : BindingList<T>,
		ITypedList
	{
		public TypedBindingList(IList<T> list, UiString name)
			: base(list)
		{
			this._name = name;
		}
		public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
		{
			var properties = TypeDescriptor.GetProperties(typeof(T));
			return properties;
		}

		private UiString _name;
		public string GetListName(PropertyDescriptor[] listAccessors)
		{
			return this._name;
		}
	}
}
